<!DOCTYPE html>
<html lang="en">
<head>
    {include file="public/meta" /}
    {include file="public/link" /}
</head>
<style>
        .red{
            color: red;
        }
        .green{
            color: green;
        }
    </style>
<body data-type="index" class="theme-white">
<div class="am-g tpl-g">
    {include file="public/header" /}
    {include file="public/left" /}
    {include file="public/content_top" /}
    <ol class="am-breadcrumb">
        <li><a href="../home/index.html" class="am-icon-home">首页</a></li>
        <li><a href="index">订单管理</a></li>
        <li class="am-active">充值列表</li>
    </ol>
    <div class="widget am-cf">
         <div class="am-form-inline" role="form">
            <span>日期范围：</span>
            <div class="am-form-group ">
                <input type="datetime-local"  name="start" placeholder="请选择起始日期"  value="{$arr.start_query}"/>
            </div>
            <div class="am-form-group ">
                <input type="datetime-local"  name="end" placeholder="请选择结束日期"  value="{$arr.end_query}"/>
            </div>
            <span>用户/订单：</span>
            <div class="am-form-group ">
                <input type="text" id="name" class="am-form-field am-input-sm" placeholder="用户" value="{$arr.name}"/>
            </div>
            <!-- <span>代理id：</span>
            <div class="am-form-group ">
                <input type="text" id="order"  name="order" class="am-form-field am-input-sm" placeholder="代理id" value="{$arr.order}"/>
            </div> -->
            <button type="button" class="am-btn am-btn-primary am-btn-sm" onclick="info_query()">查询</button>
            <button type="button" class="am-btn am-btn-warning am-btn-sm" onclick="clear_query()">清除查询</button>
        </div>
        <hr data-am-widget="divider" class="am-divider am-divider-default"/>
        <div class="widget-body widget-body-lg am-fr">
            <div class="am-scrollable-horizontal">
                <table class="{$table}">
                    <thead>
                    <tr>
                        <th>用户名称</th>
                        <th>账号余额</th>
                        <th>交易金额</th>
                        <th>时间</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name="list" id="vo" }
                    <tr>
                        <td>{$vo.user.real_name} {$vo.user.name}</td>
                        <td>¥{$vo.account.account}</td>
                        
                        <td>{$vo.time}</td>
                    </tr>
                    {/volist} 
                    <tr>
                      <th colspan="5" class="red">累计充值:¥{$re_num}</th>
                  </tr>              
                    </tbody>
                </table>
                    <div class="am-pagination-left">{$page}</div>
                <div class="dataTables_info" id="DataTables_Table_1_info">
            </div>
        </div>
    </div>
    {include file="public/content_foot" /}
</div>

{include file="public/foot" /}
<script type="text/javascript">
    $(function () {
        var nav = $('.left-sidebar li.sidebar-nav-link');
        nav.removeClass("active");
//        nav.eq(1).find('a').addClass("active");
         nav.eq(2).find('ul').show();
        nav.eq(2).find('ul li').eq(4).find('a').addClass('active');
    });

    function sub(id) {
        $.ajax({
            url: "{:url('Users/edit')}",
            type: "post",
            data: {id: id},
            success: function (r) {
                if (r['code'] == 1) {
                    alert_open(r['msg'])
                } else {
                    alert_msg(r['msg']);
                }
            }
        });
    }

    function mold(id) {
        $.ajax({
            url: "{:url('Users/mold')}",
            type: "post",
            data: {id: id},
            success: function (r) {
                if (r == 1) {
                    alert_open('操作成功');
                } else {
                    alert_msg('操作失败');
                }
            }
        });
    }
    
</script>
</body>
</html>
